﻿@namespace LaserMark.Components
@inherits EventComponentBase

@if (true)
{
    <div class="axis-ptp">
        <div class="row form-inline mt-3">
            <div class="col-9">
                <BootstrapInputNumber DisplayText="X轴位置(mm)" ShowLabel="true" @bind-Value="@XPos" Step="0.1"></BootstrapInputNumber>
            </div>
            <div class="col-3 text-center align-self-end">
                <div class="btn-group">
                    <Button Icon="fa-solid fa-play" OnClick="OnPtPX"></Button>
                    <Button Color="Color.Danger" Icon="fa fa-stop" OnClick="OnStopX"></Button>
                </div>
            </div>
        </div>
        <div class="row form-inline mt-3">
            <div class="col-9">
                <BootstrapInputNumber DisplayText="Y轴位置(mm)" ShowLabel="true" @bind-Value="@YPos" Step="0.1"></BootstrapInputNumber>
            </div>
            <div class="col-3 text-center align-self-end">
                <div class="btn-group">
                    <Button Icon="fa-solid fa-play" OnClick="OnPtPY"></Button>
                    <Button Color="Color.Danger" Icon="fa fa-stop" OnClick="OnStopY"></Button>
                </div>
            </div>
        </div>
        <div class="row form-inline mt-3">
            <div class="col-9">
                <BootstrapInputNumber DisplayText="Z轴位置(mm)" ShowLabel="true" @bind-Value="@ZPos" Step="0.1"></BootstrapInputNumber>
            </div>
            <div class="col-3 text-center align-self-end">
                <div class="btn-group">
                    <Button Icon="fa-solid fa-play" OnClick="OnPtPZ"></Button>
                    <Button Color="Color.Danger" Icon="fa fa-stop" OnClick="OnStopZ"></Button>
                </div>
            </div>
        </div>
    </div>
    <div class="axis-jog">
        <div class="row" style="margin: 10px">
            <div class="col-12 text-center">
                <Button Text="Z+" @onmousedown="async () => await OnJog(MarkOption.AxisCode.Z,MarkOption.ManualVel.Z,MarkOption.ManualAcc.Z,MarkOption.ManualDec.Z)" @onmouseup="async () => await OnStop(4)"></Button>
            </div>
            <div class="col-12">
            </div>
            <div class="col-12 text-center align-self-end">
                <Button Text="Z-" @onmousedown="async () => await OnJog(MarkOption.AxisCode.Z, MarkOption.ManualVel.Z,MarkOption.ManualAcc.Z,MarkOption.ManualDec.Z,true)" @onmouseup="async () => await OnStop(4)"></Button>
            </div>
        </div>

        <div class="row">
            <div class="col-12 text-center align-self-center">
                <Button Text="X+" @onmousedown="async () => await OnJog(MarkOption.AxisCode.X, MarkOption.ManualVel.X,MarkOption.ManualAcc.X,MarkOption.ManualDec.X)" @onmouseup="async () => await OnStop(2)"></Button>
            </div>

            <div class="col-4 text-center align-self-center">
                <Button Text="Y+" @onmousedown="async () => await OnJog(MarkOption.AxisCode.Y, MarkOption.ManualVel.Y,MarkOption.ManualAcc.Y,MarkOption.ManualDec.Y)" @onmouseup="async () => await OnStop(3)"></Button>
            </div>
            <div class="col-4 text-center align-self-center">
            </div>
            @* @if (MarkOption.)
        {

        <Button Text="空车" Color="Mock" OnClick="OnMockClick"></Button>

        } *@
            <div class="col-4 text-center align-self-center">
                <Button Text="Y-" @onmousedown="async () => await OnJog(MarkOption.AxisCode.Y, MarkOption.ManualVel.Y,MarkOption.ManualAcc.Y,MarkOption.ManualDec.Y,true)" @onmouseup="async () => await OnStop(3)"></Button>
            </div>
            <div class="col-12 text-center align-self-center">
                <Button Text="X-" @onmousedown="async () => await OnJog(MarkOption.AxisCode.X, MarkOption.ManualVel.X,MarkOption.ManualAcc.X,MarkOption.ManualDec.X,true)" @onmouseup="async () => await OnStop(2)"></Button>
            </div>
        </div>
        <div class="row" style="margin: 10px">
            <div class="col-12 text-center">
                <Button Icon="fa-solid fa-arrow-up" OnClick="OnTransforArrow" Color="ArrowColor" TooltipText="传送正转"></Button>
            </div>
            <div class="col-12 text-center">
            </div>
            <div class="col-12 text-center align-self-end">
                <Button Icon="fa-solid fa-arrow-down" OnClick="OnTransforReseve" Color="ReseveColor" TooltipText="传送反转"></Button>
            </div>
        </div>
    </div>
}
else
{
    <TipMessage></TipMessage>
}
